﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality
{
    public partial class ZodiacsEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if ("Id".OwQsIsExist())
            {
                ZodiacsDv.DefaultMode = DetailsViewMode.Edit;
            }
            else
            {
                ZodiacsDv.DefaultMode = DetailsViewMode.Insert;

            }
            ZodiacsOds.Inserted += new ObjectDataSourceStatusEventHandler(ZodiacsOds_Inserted);
            ZodiacsOds.Updated += new ObjectDataSourceStatusEventHandler(ZodiacsOds_Updated);
            ZodiacsOds.Deleted += new ObjectDataSourceStatusEventHandler(ZodiacsOds_Deleted);
        }

        private void ZodiacsOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("ZodiacsAdmin.aspx");
        }

        private void ZodiacsOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("ZodiacsAdmin.aspx");

        }

        private void ZodiacsOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("ZodiacsAdmin.aspx");

        }
    }
}